const api = require('../../../../../wxapi/config.js')
const app = getApp()
Page({
  /**
	 * 用户点击右上角分享
	 */
	onShareAppMessage: function () {
		app.globalData.isReload.isShare = true
		return {
			title: '影视行业大数据',
			path: '/pages/index/RankingList/policy/detail/detail?id=' + this.data.id
		}
	},
	/**
	 * 页面的初始数据
	 */
  data: {
    detailInfo: {},
    fileList: [],
    nr: '',
		id: ''
  },
  getPolicyDetail(val) {
    api.getPolicyDetail({id: val}).then((res) => {
      this.setData({
        detailInfo: res.data,
        fileList: res.file,
        nr: res.data.nr // .replace(/\<font/gi, '<p')
      })
    })
  },

  onLoad: function (options) {
    this.getPolicyDetail(options.id)
		this.setData({
			id: options.id
		})
  }
})